﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using Sinacor.Infra.UI.Common;
using Sinacor.UI.Bovespa.Contabil.Communication.Bovespa.Contabil.ContaContabil;
using Sinacor.Infra.UI.Security.Services;

namespace Sinacor.UI.Bovespa.Contabil.Communication.Translator.ModelToDataContract
{
    /// <summary>
    /// FGualberto.7COMm - Task: 6312
    /// </summary>
    class HistoricoContabil
    {
        /// <summary>
        /// Para Filtro Contabil Request - Unitário
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public FiltroHistoricoContabilRequest ToFiltroHistoricoContabilRequest(Model.Parameter.FiltroHistoricoContabil from)
        {
            FiltroHistoricoContabilRequest to = new FiltroHistoricoContabilRequest();

            to.Codigo = from.Codigo;
            to.Descricao = from.Descricao;

            return to;
        }

        /// <summary>
        /// Para Filtro Contabil Request - Coleção
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public List<FiltroHistoricoContabilRequest> ToFiltroHistoricoContabilRequest(ModelCollection<Model.Parameter.FiltroHistoricoContabil> from)
        {
            List<FiltroHistoricoContabilRequest> lista = new List<FiltroHistoricoContabilRequest>();

            foreach (Model.Parameter.FiltroHistoricoContabil req in from)
            {
                FiltroHistoricoContabilRequest to = new FiltroHistoricoContabilRequest();

                to.Codigo = req.Codigo;
                to.Descricao = req.Descricao;

                lista.Add(to);
            }

            return lista;
        }
    }
}
